<#import "/META-INF/spring.ftl" as spring />
<#import "/META-INF/mspring.ftl" as mspring />
<#include "../../inc/header.ftl" />
<link rel="stylesheet" type="text/css" href="${base}/script/lhgcalendar/skins/lhgcalendar.css">
<script type="text/javascript" src="${base}/script/lhgcalendar/lhgcalendar.min.js"></script>
<form id="topicReplyForm" name="topicReplyForm" action="${base}/admin/bbs/topicReply/list" method="POST">
	<@spring.bind "topicReply" />
	<table>
		<tr>
			<td class="fieldlabel" style="width:50px;">用户编号</td>
			<td>
				<@spring.formInput path="topicReply.author.id" attributes='class="textinput"' />
			</td>
			
			<td class="fieldlabel" style="width:50px;">用户名</td>
			<td>
				<@spring.formInput path="topicReply.author.name" attributes='class="textinput"' />
			</td>
			
			<td class="fieldlabel" style="width:50px;">用户昵称</td>
			<td>
				<@spring.formInput path="topicReply.author.alias" attributes='class="textinput"' />
			</td>
			
			<td class="fieldlabel" style="width:50px;">创建时间</td>
			<td>
				<input type="text" class="textinput" name="createTimeBeg" id="createTimeBeg" value="${createTimeBeg!""}" style="width:85px;" /> - 
				<input type="text" class="textinput" name="createTimeEnd" id="createTimeEnd" value="${createTimeEnd!""}" style="width:85px;" />
			</td>
			<td><input type="submit" class="btn" value=" 查 询 " /></td>
		</tr>
	</table>
		
	<@spring.bind "topicReplyPage" />
	<!-- pagination parameter -->
	<@spring.formHiddenInput path="topicReplyPage.pageNo" />
	<@spring.formHiddenInput path="topicReplyPage.totalPages" />
	<@spring.formHiddenInput path="topicReplyPage.totalCount" />
	<!-- sorter parameter -->
	<@spring.formHiddenInput path="topicReplyPage.sortEnable" />
	<@spring.formHiddenInput path="topicReplyPage.sort.field" />
	<@spring.formHiddenInput path="topicReplyPage.sort.order" />
	<table class="dtable" cellspacing="0" cellpadding="0">
		<tr>
			<th><input type="checkbox" onclick="mlog.form.checkAll(this, 'id');" /></th>
			<th onclick="sortField(this, 'topicReplyForm', 'id');" id='id_sort'>编号</th>
			<th onclick="sortField(this, 'topicReplyForm', 'topic.forum.id');" id='topic.forum.id_sort'>版块</th>
			<th onclick="sortField(this, 'topicReplyForm', 'topic.id');" id='topic.id_sort'>帖子</th>
			<th onclick="sortField(this, 'topicReplyForm', 'postIp');" id='postIp_sort'>IP</th>
			<th onclick="sortField(this, 'topicReplyForm', 'createTime');" id='createTime_sort'>发布时间</th>
			<th onclick="sortField(this, 'topicReplyForm', 'author.alias');" id='author.alias_sort'>作者</th>
			<th>操作</th>
		</tr>
		<#if topicReplyPage??>
			<#list topicReplyPage.result as item>
				<#assign tdClass = "odd">
				<#if item_index%2 == 0>
					<#assign tdClass = "even">
				</#if>
				<tr>
					<td class="${tdClass}"><input type="checkbox" name="id" value="${item.id}" /></td>
					<td class="${tdClass}">${item.id}</td>
					<td class="${tdClass}"><a href="${base}/forums/${item.topic.forum.id}" target="_blank">${item.topic.forum.name}</a></td>
					<td class="${tdClass}"><a href="${base}/forums/topic/${item.topic.id}" target="_blank">${item.topic.title}</a></td>
					<td class="${tdClass}">${item.postIp}</td>
					<td class="${tdClass}">${item.createTime}</td>
					<td class="${tdClass}"><a href="<@userSpaceUrl name=item.author.name/>" target="_blank">${item.author.alias}</a></td>
					<td class="${tdClass}">
						<#--<a href="${base}/admin/bbs/topicReply/edit?id=${item.id}">修改</a>-->
					</td>
				</tr>
			</#list>
		</#if>
	</table>
	<table style="width:100%;">
		<tr>
			<td>
				<input type="button" class="btn" value=" 删除 " onclick="mlog.form.confirmSubmit('topicReplyForm', '${base}/admin/bbs/topicReply/delete', '确认要将删除选中项吗?');" />
			</td>
			<td>
				<@mspring.pagingnavigator page=topicReplyPage form_id="topicReplyForm" />
			</td>
		</tr>
	</table>
</form>
<script type="text/javascript">
	function code(id){
		mlog.dialog.showDialog({
			title: '获取代码',
			content: '&lt;@ad id=' + id + ' /&gt;',
			max: false,
			min: false
		});
	}
	$(document).ready(function(){
		$("#createTimeBeg").calendar({ maxDate:'#createTimeEnd', format:'yyyy-MM-dd HH:mm:ss', targetFormat:'yyyy-MM-dd HH:mm:ss' });
		$("#createTimeEnd").calendar({ minDate:'#createTimeBeg', format:'yyyy-MM-dd HH:mm:ss', targetFormat:'yyyy-MM-dd HH:mm:ss' });
	});
</script>
<#include "../../inc/footer.ftl" />